ifNotEmpty

inline fun <T> Array<out T>.ifNotEmpty(action: Array<out T>.() -> Unit): Array<out T>(source)

Applies the action to this array if it's not empty.


inline fun <T, C : Collection<T>> C.ifNotEmpty(action: C.() -> Unit): C(source)

Applies the action to this collection if it's not empty.


inline fun <K, V, M : Map<K, V>> M.ifNotEmpty(action: M.() -> Unit): M(source)

Applies the action to this map if it's not empty.